package com.wisemoresystem.seal.service;

import java.util.List;

import org.springframework.stereotype.Service;

import com.wisemoresystem.seal.base.service.BaseService;
import com.wisemoresystem.seal.model.t_bank_level;

@Service
public class BankLevelService extends BaseService {

	// 获取银行列表
	public List<t_bank_level> selectBankLevel() {
		String hql = "from t_bank_level t where t.status=0 order by t.sort asc ";
		List<t_bank_level> list = (List<t_bank_level>) ht.find(hql);

		return list;
	}

	// 获取银行列表(起止水平)
	public List<t_bank_level> selectBankLevel(int start, int end) {
		String hql = "from t_bank_level t where t.status=0 and t.sort>=? and t.sort<=? order by t.sort asc ";
		List<t_bank_level> list = (List<t_bank_level>) ht.find(hql, end, start);

		return list;
	}

	// 根据名称查找银行级别
	public t_bank_level getLevelByName(String name) {
		String hql = "from t_bank_level t where t.status=0 and t.name=? order by t.sort asc ";
		t_bank_level level = super.findObj(hql, name);

		return level;
	}
}
